//
//  DataControl.h
//  tcpoctest
//
//  Created by gump on 10/26/12.
//  Copyright (c) 2012 gump. All rights reserved.
//

@class FirendInfo;
@class ChatContentInfo;
@class UserInfo;
@class CareDataSource;
@class PromptLoginDataSource;
@class FirendCircleDataSource;
@class FirCirLocalResourceDataSource;
@class FirCirCommentDataSource;
@class LocalPathDataSource;
@class FirCirNewsDataSource;
@class FirCirCommentInfo;
@class FirCirNewsMailDataSource;
@class FirCirBgImageDataSource;
@class FirCirPersonDataSource;
@class VersionDataSource;
@class OnlinePeopleDataSource;
@class UICommendDataSource;
@class LogicCommendDataSource;

@class GiftListDataSource;
@class GiftInfoDataSource;
@class GiftMessageDataSource;
@class giftStroageDataSource;

@class RankListDataSource;

@class taskDataSource;

@class personDataSource;

@class chatDataSource;

@class MessageDataSource;

@class TelepathyDataSource;

@class bigHeadImageDataSource;

pthread_mutex_t         mymutexFirendCir;//firend circle mutex

@interface DataControl : NSObject
{
}

//show main   prompt
@property(nonatomic,strong) PromptLoginDataSource           *promptloginDS;

//head image
@property(nonatomic,strong) UIImage                 *iImage;


@property(nonatomic,strong) NSMutableArray          *mapArray;

//care data
@property(nonatomic,strong) CareDataSource      *careds;
@property(nonatomic,strong) CareDataSource      *becareds;

@property(nonatomic,strong) FirendInfo          *currentFI;

@property(nonatomic)        float           mlatitude;
@property(nonatomic)        float           mlongitude;
//near people 
@property(nonatomic,strong) NSMutableDictionary         *nearPeopleDistanceDic;
@property(nonatomic,strong) NSMutableArray              *nearPeopleShowArr;

@property(nonatomic,strong) NSMutableDictionary         *nearFemaleDic;
@property(nonatomic,strong) NSMutableArray              *nearFemaleShowArr;

@property(nonatomic,strong) NSMutableDictionary         *nearMaleDic;
@property(nonatomic,strong) NSMutableArray              *nearMaleShowArr;

@property(nonatomic,assign) NSMutableArray              *nearPeopleCurShowArr;
@property(nonatomic,assign) NSMutableDictionary         *nearPeopleCurDic;

@property(nonatomic)        bool                        blogin;
@property(nonatomic)        bool                        bfirstlogin;

@property(nonatomic,strong) LogicCommendDataSource      *LCDS;
@property(nonatomic,strong) UICommendDataSource         *UICommendDS;

@property                   int                         iLoginFailID;
@property                   int                         iConfigFailID;
@property                   int                         iGameState;
@property                   int                         iSerchPPNum;

//local path
@property(nonatomic,strong) LocalPathDataSource         *localpathds;

//message info
@property(nonatomic,strong) MessageDataSource          *messageDS;

//set info
@property(nonatomic,strong) NSString                *strChangeName;
@property                   int                     iUUT;//update user type
@property                   int                     ichangeSex;
@property                   int                     ichangeAge;
@property(nonatomic,strong) NSString                *strChangeOldPS;
@property(nonatomic,strong) NSString                *strChangeNewPS;
@property(nonatomic,strong) NSString                *strChangeSign;
@property                   char                    ichangeNeedCheck;

//head image
@property(nonatomic,strong) NSMutableDictionary     *HeadImageDic;
@property(nonatomic,strong) NSMutableSet            *headImageRequestSet;
@property(nonatomic,strong) NSMutableArray          *headImageSendArr;

//user info
@property                   int                     mloginType;
//firend info
@property(nonatomic,strong) NSMutableDictionary     *firendInfoDic;
@property(nonatomic,strong) NSMutableSet            *firendInfoRequestSet;
@property(nonatomic,strong) NSMutableArray          *firendInfoSendArr;

//bag
@property                   int                     mBadgeCount;
@property                   int                     miOldGameState;

@property                   int                     mNearPeopleType;
@property                   float                   mVisitNearPeopleTime;
@property                   int                     mOldNPT;//old near people type
@property                   float                   mVisitNPFamaleTime;
@property                   float                   mVisitNPMaleTime;

@property(nonatomic,assign) NSString                *reportMail;//举报帐号

//firend circle
@property(nonatomic,strong) FirendCircleDataSource          *fircirDS;
@property(nonatomic,strong) FirCirLocalResourceDataSource   *fcLocalRecDS;
@property(nonatomic,strong) FirCirCommentDataSource         *fccommentDS;
@property(nonatomic,strong) FirCirNewsDataSource            *fcnewsDS;
@property(nonatomic,strong) FirCirNewsMailDataSource        *fcnewsmailDS;
@property(nonatomic,strong) FirCirBgImageDataSource         *fcBgImageDS;
@property(nonatomic,strong) FirCirPersonDataSource          *fcPersonDS;
@property(nonatomic,strong) VersionDataSource               *verDS;
@property(nonatomic,strong) OnlinePeopleDataSource          *OnlinePeoDS;

//gift
@property(nonatomic,strong) GiftListDataSource              *giftlistDS;
@property(nonatomic,strong) GiftInfoDataSource              *giftInfoDS;
@property(nonatomic,strong) GiftMessageDataSource           *giftMessageDS;
@property(nonatomic,strong) giftStroageDataSource           *giftStroageDS;

//ranklist
@property(nonatomic,strong) RankListDataSource              *ranklistDS;
//task
@property(nonatomic,strong) taskDataSource                  *taskDS;
//person
@property(nonatomic,strong) personDataSource                *personDS;
//chat
@property(nonatomic,strong) chatDataSource                  *chatDS;//聊天数据源
//telepathy
@property(nonatomic,strong) TelepathyDataSource             *TelepathyDS;//心电感应数据源
//bigimage
@property(nonatomic,strong) bigHeadImageDataSource          *bigHIDS;//大头像数据源

+(DataControl*)shareControl;

-(void)SetLoginFailID:(int)failID;
-(void)SetGameState:(int)state;
-(void)setHeadImage:(UIImage *)hi;
-(void)setSearchPPNum:(int)ppnum;
-(void)setCurrentFirendInfo:(FirendInfo *)fi;
-(void)SetChangeName:(NSString *)strname;
-(void)SetUpdateUserType:(int)itype;
-(void)SetChangeSex:(int)isex;
-(void)SetChangeAge:(int)iage;
-(void)SetChangeSign:(NSString *)strsign;
-(void)SetChangeCheck:(int)icheck;
-(void)SetLoginType:(int)type;
-(void)UpdateUserImage;
-(void)SetConfigFailID:(int)len;
-(void)SetReportMail:(NSString *)mail;

-(FirendInfo *)SearchInfo:(NSString *)mail;
-(NSString *)SearchHeadImage:(NSString *)mail;
-(void)RefreshInfoByNet:(NSString *)mail;

-(bool)IsNeedVisitNearPeople;
-(bool)IsNeedVisitNPFamale;
-(bool)IsNeedVisitNPMale;
-(void)clearNearPeopleData;

-(void)clearData;
-(void)UpdateUserImageFromNet:(NSString *)mail;

-(void)UpdateImageWithMail:(NSString *)mail withImage:(UIImage *)image;

//firend circle
-(void)AddComment:(FirCirCommentInfo *)fccinfo;//添加评论到数据源

@end
